package Model.extract_feature_point_test_data;

import Model.DrawModel.CalPoint;

import java.util.ArrayList;

public class TestData {

    static Double distance = 0.001;

    public static ArrayList<CalPoint> GetRectangleShips() {
        ArrayList<CalPoint> result = new ArrayList<>();
        for (double i = 0.0; i <= 50; i += distance) {
            result.add(new CalPoint(0 , i));
        }
        for (double i = 0.0; i <= 100; i += distance) {
            result.add(new CalPoint(i , 50));
        }
        for (double i = 50.0; i >= 0; i -= distance) {
            result.add(new CalPoint(100 , i));
        }
        for (double i = 100; i >= 0; i -= distance) {
            result.add(new CalPoint(i , 0));
        }
        return result;
    }

    public static ArrayList<CalPoint> GetPentagramShips() {
        ArrayList<CalPoint> result = new ArrayList<>();

        for (double i = 0.0; i <= 10; i += distance) {
            result.add(new CalPoint(i , -5*i + 50));
        }
        for (double i = 10.00001; i <= 60; i += distance) {
            result.add(new CalPoint(i , 0));
        }

        for (double x = 60; x >= 20; x -= distance) {
            result.add(new CalPoint(x , 0.5*x - 30));
        }

        for (double x = 20; x <= 55; x += distance) {
            result.add(new CalPoint(x , -1.1428571428571428*x + 2.857142857142854));
        }

        for (double x = 55; x >= 0; x -= distance) {
            result.add(new CalPoint(x , -0.36363636363636365*x - 40));
        }


        for (double x = 0; x >= -55; x -= distance) {
            result.add(new CalPoint(x , 0.36363636363636365*x - 40));
        }

        for (double x = -55; x <= -20; x += distance) {
            result.add(new CalPoint(x , 1.1428571428571428*x + 2.857142857142854));
        }

        for (double x = -20; x >= -60; x -= distance) {
            result.add(new CalPoint(x , -0.5*x - 30));
        }

        for (double i = -60; i <= -10; i += distance) {
            result.add(new CalPoint(i , 0));
        }
        for (double i = -10; i <= 0; i += distance) {
            result.add(new CalPoint(i , 5*i + 50));
        }

        return result;
    }

    public static ArrayList<CalPoint> GetCircleAndTriangleShips() {
        ArrayList<CalPoint> result = new ArrayList<>();

        double radius = 50.0;

        for (double i = Math.PI; i >= 0; i -= distance) {
            result.add(new CalPoint(radius * Math.cos(i) , radius * Math.sin(i)));
        }

        for (double x = 50; x >= 0; x -= distance) {
            result.add(new CalPoint(x , x - 50));
        }
        for (double x = 0; x >= -50; x -= distance) {
            result.add(new CalPoint(x , -x - 50));
        }

        return result;
    }


}
